# $Id: PKGBUILD 84371 2013-02-17 02:30:26Z bgyorgy $
# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=ocrfeeder
pkgver=0.7.11
pkgrel=2
pkgdesc="GTK+ document layout analysis and optical character recognition application"
arch=('any')
url="http://live.gnome.org/OCRFeeder"
license=('GPL')
depends=('python2-pyenchant' 'pygoocanvas' 'python2-gtkspell' 'python2-imaging' 'python2-lxml' 'python2-reportlab' 'ghostscript' 'unpaper' 'sane' 'desktop-file-utils')
makedepends=('intltool' 'gnome-doc-utils')
optdepends=('tesseract: character recognition'
            'ocrad: character recognition'
            'gocr: character recognition'
            'cuneiform: character recognition')
install=$pkgname.install
source=(http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
sha256sums=('4508f4a0e2fdab521ab4a6d0265058a21fda80622483b169fd041189938ea6d5')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  sed -i 's@^#!.*python$@#!/usr/bin/python2@' bin/ocrfeeder*.in src/ocrfeeder/odf/*.py

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              PYTHON=python2
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir/" install
  mkdir -p "$pkgdir/usr/share/pixmaps"
  ln -s ../ocrfeeder/icons/ocrfeeder.svg "$pkgdir/usr/share/pixmaps/ocrfeeder.svg"
}
